package com.webservice;

import com.domain.Equipment;
import com.domain.Equipment_type;

import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import java.util.List;

//新浪云http://mmms.applinzi.com/ws/equipment
//本地http://39.98.59.6/mmms_test/ws/equipment
@WebService(targetNamespace = "http://39.98.59.6/mmms_test/ws/equipment")
public interface EquipmentWebservice {

    public int addEquipment(@WebParam(name = "equipment") Equipment equipment);


    /**
     * 根据单位查询所有设备
     * @param insiderUnit_id
     * @return
     */
    @WebResult(name = "EquipmentList")
    public List<Equipment> findAllEquipmentByInsiderUnit(@WebParam(name = "insiderUnit_id") Integer insiderUnit_id);

    /**
     * 根据设备管理员id查询设备
     * @param user_id
     * @return
     */
    @WebResult(name = "EquipmentList")
    public List<Equipment> findByUser_id(@WebParam(name = "user_id") Integer user_id);

    /**
     * 根据id查找设备
     * @param equipment_id
     * @return
     */
    @WebResult(name = "Equipment")
    public Equipment findById(@WebParam(name = "equipment_id")Integer equipment_id);

    /**
     * 设备管理员修改未锁定的设备
     * @param equipment
     */
    @WebResult(name = "int")
    public int updateEquipment(@WebParam(name = "equipment")Equipment equipment);

    /**
     * 设备管理员删除未锁定的设备
     * @param id
     */
    public void delEquipment(@WebParam(name = "id") Integer id);

    /**
     * 查询某年某月某设备的维修金额
     * @param equipment_id
     * @param time
     * @return
     */
    public Float priceEquipment(@WebParam(name = "equipment_id")Integer equipment_id,
                                @WebParam(name = "time")String time);

    /**
     * 查询所有设备类型
     * @return
     */
    public List<Equipment_type> findAllType();

    /**
     * 部门查询所有设备

     * @return
     */
    public List<Equipment> findAllEquipment();
}
